package com.ht.medicaltreatment.adapter

import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.ht.medicaltreatment.R
import com.ht.medicaltreatment.bean.CheckGroupBeanRfidSample

class GroupNameAdapter : BaseQuickAdapter<CheckGroupBeanRfidSample, BaseViewHolder>(R.layout.item_group_name_layout){
    override fun convert(holder: BaseViewHolder, item: CheckGroupBeanRfidSample) {
        val name = holder.getView<TextView>(R.id.tvName)
        val tvStatus = holder.getView<TextView>(R.id.tvStatus)
        name.setText(item.name)
        if(item.checkType == 0){
            tvStatus.setText("未识别")
            tvStatus.setTextColor(context.getColor(R.color.color97))
            name.setTextColor(context.getColor(R.color.color97))
        }else{
            tvStatus.setText("正确")
            tvStatus.setTextColor(context.getColor(R.color.green))
            name.setTextColor(context.getColor(R.color.green))
        }
    }

}
